package com.hc.springbootredis.repository;

import com.hc.springbootredis.entity.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;


public interface CommentRepository extends JpaRepository<Comment,Integer> {
    @Transactional
    @Modifying
    @Query("update t_comment c set c.author=?1 where c.id=?2")
    int updateComment(String author,Integer id);
}
